package qwq.zyu.Hologram;

import eu.decentsoftware.holograms.api.DHAPI;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class qwqRemoveHologramCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 1) {
            sender.sendMessage(ChatColor.RED + "用法: /qwq_remove_hologram <全息图名称>");
            return false;
        }

        String hologramName = args[0];

        if (DHAPI.getHologram(hologramName) != null) {
            DHAPI.removeHologram(hologramName);
            sender.sendMessage(ChatColor.GREEN + "全息图 '" + hologramName + "' 已成功删除！");
        } else {
            sender.sendMessage(ChatColor.RED + "全息图 '" + hologramName + "' 不存在！");
        }

        return true;
    }
}